package com.xf.lastmall.service.impl;


import com.xf.lastmall.moudle.entity.OrderMainEntity;
import com.xf.lastmall.repository.OrderMainRepository;
import com.xf.lastmall.service.OrderMainService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 */
@Slf4j
@Service
public class OrderMainServiceImpl implements OrderMainService {
    @Resource
    private OrderMainRepository orderMainRepository;

    @Override
    public int updateOrderStatus(String updateStatus, String status, Date date, String orderNo) {
        return orderMainRepository.updateOrderStatus(updateStatus, status, date, orderNo);
    }

    @Override
    public OrderMainEntity findOrderMainEntityByOrderNo(String orderNo) {
        return orderMainRepository.findByOrderNo(orderNo);
    }

    @Override
    public void deleteOrder(String orderNo) {
        orderMainRepository.deleteByOrderNo(orderNo);
    }


}
